package com.jake.xfeed.recyclerfeed;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.DiffUtil;
import androidx.recyclerview.widget.ListUpdateCallback;
import androidx.recyclerview.widget.RecyclerView;

public class RecyclerViewDiffUtils {
    public static void updateData(@NonNull DiffUtil.Callback callback, @NonNull ListUpdateCallback updateCallback) {
        DiffUtil.DiffResult diffResult = DiffUtil.calculateDiff(callback);
        diffResult.dispatchUpdatesTo(updateCallback);
    }

    public static void updateData(@NonNull DiffUtil.Callback callback, @NonNull RecyclerView.Adapter adapter) {
        DiffUtil.DiffResult diffResult = DiffUtil.calculateDiff(callback);
        diffResult.dispatchUpdatesTo(adapter);
    }
}
